package com.example.financeapi.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 我的申购表(F_MY_PURCHASE)实体类
 * @author Alvin
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class FMyPurchase implements Serializable {
    private static final long serialVersionUID = 1L;
    /**id*/
    private Integer id;
    /**证券代码*/
    private String bndTrdCode;
    /**证券名称*/
    private String bndSecuSht;
    /**申购价格*/
    private String price;
    /**申购数量*/
    private String purchaseNumber;
    /**普通用户*/
    private String regularUser;
    /**绑定证券用户id*/
    private Integer accountId;
    /**是否中签 0未中签 1中签*/
    private String isLuckynumber;
    /**起始配号*/
    private String initialSign;
    /**配号数*/
    private String coordinatesNumber;
    /**备注*/
    private String remark;
    /**中签数*/
    private String luckynum;
    /**中签日期*/
    private String luckydate;
    /**申购数*/
    private String purchasenum;
    /**申购日期*/
    private String purchasedate;
    /**客户号*/
    private String customeCode;
    /**申购状态 0申购失败 1申购成功*/
    private String status;

    public String getIsLuckynumber() {
        if(StringUtils.isNotBlank(isLuckynumber)){
            isLuckynumber= "0".equals(isLuckynumber)==true?"未中签":"中签";
        }
        return isLuckynumber;
    }

    public String getStatus() {
        if(StringUtils.isNotBlank(status)){
            status= "0".equals(status)==true?"申购失败":"申购成功";
        }
        return status;
    }
}